home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / alien-glow-bar.scm < prev    next >
Encoding:
Text File  |  2009-08-19  |  3.6 KB  |  100 lines

  1. ; GIMP - The GNU Image Manipulation Program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; Alien Glow themed hrule for web pages
  5. ; Copyright (c) 1997 Adrian Likins
  6. ; aklikins@eos.ncsu.edu
  7. ;
  8. ;
  9. ; This program is free software: you can redistribute it and/or modify
  10. ; it under the terms of the GNU General Public License as published by
  11. ; the Free Software Foundation; either version 3 of the License, or
  12. ; (at your option) any later version.
  13. ;
  14. ; This program is distributed in the hope that it will be useful,
  15. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. ; GNU General Public License for more details.
  18. ;
  19. ; You should have received a copy of the GNU General Public License
  20. ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
  21.  
  22. (define (script-fu-alien-glow-horizontal-ruler length
  23.                                                height
  24.                                                glow-color
  25.                                                bg-color
  26.                                                flatten)
  27.   (let* (
  28.         (img (car (gimp-image-new height length RGB)))
  29.         (border (/ height 4))
  30.         (ruler-layer (car (gimp-layer-new img
  31.                                           (+ length height) (+ height height)
  32.                                           RGBA-IMAGE "Ruler" 100 NORMAL-MODE)))
  33.         (glow-layer (car (gimp-layer-new img
  34.                                          (+ length height) (+ height height)
  35.                                          RGBA-IMAGE "Alien Glow" 100 NORMAL-MODE)))
  36.         (bg-layer (car (gimp-layer-new img
  37.                                        (+ length height) (+ height height)
  38.                                        RGB-IMAGE "Background" 100 NORMAL-MODE)))
  39.         )
  40.  
  41.     (gimp-context-push)
  42.  
  43.     (gimp-image-undo-disable img)
  44.     (gimp-image-resize img (+ length height) (+ height height) 0 0)
  45.     (gimp-image-add-layer img bg-layer 1)
  46.     (gimp-image-add-layer img glow-layer -1)
  47.     (gimp-image-add-layer img ruler-layer -1)
  48.  
  49.    ; (gimp-layer-set-lock-alpha ruler-layer TRUE)
  50.     (gimp-context-set-background bg-color)
  51.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  52.     (gimp-edit-clear glow-layer)
  53.     (gimp-edit-clear ruler-layer)
  54.  
  55.     (gimp-rect-select img
  56.                       (/ height 2) (/ height 2)
  57.                       length height CHANNEL-OP-REPLACE FALSE 0)
  58.     (gimp-context-set-foreground '(79 79 79))
  59.     (gimp-context-set-background '(0 0 0))
  60.  
  61.     (gimp-edit-blend ruler-layer FG-BG-RGB-MODE NORMAL-MODE
  62.                      GRADIENT-SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE
  63.                      FALSE 0 0 TRUE
  64.                      0 0 height height)
  65.  
  66.     (gimp-context-set-foreground glow-color)
  67.     (gimp-selection-grow img border)
  68.     (gimp-edit-fill glow-layer FOREGROUND-FILL)
  69.     (gimp-selection-none img)
  70.     (plug-in-gauss-rle RUN-NONINTERACTIVE img glow-layer 25 TRUE TRUE)
  71.  
  72.     (gimp-image-undo-enable img)
  73.  
  74.     (if (= flatten TRUE)
  75.         (gimp-image-flatten img))
  76.  
  77.     (gimp-display-new img)
  78.  
  79.     (gimp-context-pop)
  80.   )
  81. )
  82.  
  83.  
  84. (script-fu-register "script-fu-alien-glow-horizontal-ruler"
  85.     _"_Hrule..."
  86.     _"Create an Hrule graphic with an eerie glow for web pages"
  87.     "Adrian Likins"
  88.     "Adrian Likins"
  89.     "1997"
  90.     ""
  91.     SF-ADJUSTMENT _"Bar length"       '(480 5 1500 1 10 0 1)
  92.     SF-ADJUSTMENT _"Bar height"       '(16 1 100 1 10 0 1)
  93.     SF-COLOR      _"Glow color"       '(63 252 0)
  94.     SF-COLOR      _"Background color" "black"
  95.     SF-TOGGLE     _"Flatten image"    TRUE
  96. )
  97.  
  98. (script-fu-menu-register "script-fu-alien-glow-horizontal-ruler"
  99.                          "<Image>/File/Create/Web Page Themes/Alien Glow")
  100.